package com.ruiyian.project.road.service.impl;

import com.ruiyian.common.annotation.DataScope;
import com.ruiyian.project.road.domain.Road;
import com.ruiyian.project.road.mapper.RoadMapper;
import com.ruiyian.project.road.service.RoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chong
 * @email 673426164@qq.com
 * @create 2021/1/19
 * Desc: 道路实现层
 */
@Service
public class RoadServiceImpl implements RoadService {

    @Autowired
    private RoadMapper roadMapper;


    /**
     * 查询列表
     * @param road
     * @return
     */
    @DataScope(deptAlias = "d")
    @Override
    public List<Road> selectList(Road road) {
        return roadMapper.selectList(road);
    }
    /**
     * 保存
     * @param road
     */
    @Override
    public void save(Road road) {
        roadMapper.save(road);
    }


    /**
     * 编辑
     * @param road
     */
    @Override
    public void edit(Road road) {
        roadMapper.edit(road);
    }
    /**
     * 删除
     * @param id
     */
    @Override
    public void delete(Long id) {
        roadMapper.delete(id);
    }

    /**
     * 根据id获取对象
     * @param id
     * @return
     */
    @Override
    public Road findOne(Long id) {
        return roadMapper.findOne(id);
    }

    /**
     * 批量删除
     * @param list
     */
    @Override
    public void deleteBatch(List<Road> list) {
        roadMapper.deleteBatch(list);
    }


    @Override
    public Road getRoadAll(Long id) {
        return roadMapper.getRoadAll(id);
    }
}
